<template>
  <el-container direction="vertical" class="girl-detail-wrapper">
    <div class="girl-detail-header-banner">
      <img :src="girlDetailData.url" class="z-auto" alt="关于">
      <el-breadcrumb class="girl-detail-menu" separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/gankio' }" v-if="toTarget === 'gankio'">干货集中营</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/girl' }" v-else>妹纸</el-breadcrumb-item>
        <el-breadcrumb-item>妹纸详情</el-breadcrumb-item>
      </el-breadcrumb>
      <div class="girl-detail-info">
        <div class="girl-type">#妹纸#</div>
        <div class="girl-title">妹纸图{{girlDetailData.title}}</div>
        <div class="girl-introduce">
          <span>{{girlDetailData.author}}</span>
          <span>发布于 {{girlDetailData.createdAt}}</span>
          <span>{{girlDetailData.views}}</span>
          <span>{{girlDetailData.likeCounts}}</span>
          <span>{{girlDetailData.stars}}</span>
        </div>
      </div>
    </div>
    <div class="girl-detail-content">

      <div class="detail-introduce">{{girlDetailData.desc}}​​​​</div>
      <img class="detail-image" :src="girlDetailData.url"/>
      <div class="detail-annotation">注: 图片与文字均来自网络且无相关性</div>
    </div>
  </el-container>
</template>

<script>
  import { getArticleDetails } from '../../../api/index'
  export default {
    name: 'GirlDetail',
    data () {
      return {
        girlId: this.$route.query.id,
        toTarget: this.$route.query.type,
        girlDetailData: {},
      }
    },
    mounted () {
      this.getArticleDetailsData()
    },
    methods: {
      getArticleDetailsData () {
        getArticleDetails(this.girlId).then(data => {
          if (data.status === 100) {
            this.girlDetailData = data.data
          }
        }).catch(error => {

        })
      }
    },
    watch: {}
  }
</script>

<style lang="scss" ref="stylesheet/scss" scoped>
  .girl-detail-wrapper {
    width: 100%;

    .girl-detail-header-banner {
      width: 100%;
      margin-bottom: 20px;
      background: rgba(26, 16, 55, 0.5);
      height: 500px;

      img {
        opacity: 0.5;
        object-fit: cover;
        width: 100%;
        height: 100%;
      }
      .girl-detail-menu {
        position: absolute;
        left: 130px;
        top: 120px;
      }

      .girl-detail-info {
        text-align: left;
        position: absolute;
        left: 140px;
        top: 140px;

        .girl-type {
          margin-top: 8px;
          background-color: rgba(44, 99, 255, 1);
          color: white;
          width: 38px;
          text-align: center;
          padding: 2px 8px;
          font-size: 12px;
          border-radius: 2px;
        }
        .girl-title {
          margin-top: 8px;
          font-size: 20px;
          color: white;
          font-weight: bold;
        }
        .girl-introduce {
          margin-top: 8px;
          color: white;
          font-size: 10px;

          span {
            margin-right: 8px;
          }
        }
      }
    }

    .girl-detail-content {
      background-color: rgba(29, 31, 32, 1);
      width: 60%;
      border-radius: 5px;
      padding: 20px;
      margin: 0 auto;

      .detail-introduce {
        color: white;
        font-size: 20px;
        font-weight: bold;
        line-height: 40px;
      }
      .detail-image {
        width: 100%;
        margin-top: 5px;
        border-radius: 5px;
        display: block;
        object-fit: fill;
      }
      .detail-annotation {
        font-size: 8px;
        margin: 20px 0;
        color: #F2F2F2;
        text-align: left;
      }
    }
  }

</style>
